package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class TravelQueryObject extends QueryObject{
    //状态
    private int state;//游记状态
    private Long destId = -1L;
    //天数
    private int dayType = -1;
    //旅游天数查询范围
    private TravelCondition days;
    //出发时间
    private int travelTimeType = -1;  //出发时间(月份)
    private TravelCondition travelTime;
    //人均消费
    private int perExpendType = -1;  //人均消费类型
    private TravelCondition perExpends;
    public TravelCondition getDays(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    public TravelCondition getPerExpends(){
        return TravelCondition.TRAVEL_PRE_EXPENDS.get(perExpendType);
    }

    //排序
    private int orderType = 1;
    public String getOrderBy(){
        if(orderType == 1){
            return "t.createTime desc";
        }
        return "t.viewnum desc";
    }
}
